# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=memfetch
pkgver=0.05b
pkgrel=4
pkgdesc='Dumps any userspace process memory without affecting its execution.'
url='http://lcamtuf.coredump.cx/'
license=('GPL')
groups=('blackarch' 'blackarch-forensic')
makedepends=('make')
depends=('glibc')
arch=('x86_64' 'aarch64')
source=("http://lcamtuf.coredump.cx/soft/$pkgname.tgz"
        'memfetch_pagesize.patch')
sha512sums=('f8abe55244a1842ee6942a5178e641521fcd0e6cb2a67e871a54b1d505921b35cb4c32ff87c955176e48a0e30edbf3ff6f64bfd9f88956a500de6666420788a3'
            '5d02a869984dea7eebb43ddb8ce722e10eb0f3e96cd6e25b9ccdb61b517065145013df1e28951f39469703e897ab9c806744e04db6f4069e63bea240c4cf560c')

build() {
  cd $pkgname

  patch -p0 "$srcdir/memfetch/memfetch.c" < "$srcdir/memfetch_pagesize.patch"

  make CFLAGS="$CFLAGS"
}

package(){
  cd $pkgname

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
}

